package com.xframe.domain.e3sp.bu.sale;

import com.xframe.domain.BaseModel;
import com.xframe.domain.e3sp.maindata.SparePartBaseView;
import com.xframe.domain.e3sp.maindata.wh.WareHouse;
import com.xframe.xdal.core.annotation.AutoFill;
import com.xframe.xdal.core.annotation.XBelongsTo;
import com.xframe.xdal.core.annotation.XColumn;
import com.xframe.xdal.core.annotation.XTable;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
 * com.xframe.domain.e3sp.bu.sale.Meetbill
 * @author zjj
 * @create 2024/4/20 14:10
 */

@Data
@Accessors(chain=true)
@XTable(value = "bu_t01_meetbill", label = "国内分配单",dataSourceCode = "warehouse")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.wh.WareHouse",foreignKey = "wareHouseId",
        targetKey = "wareHouseId",as = "refWareHouse")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.SparePartBaseView",foreignKey = "sparePartId",
        targetKey = "sparePartId",as = "refSparePartBaseView")
public class Meetbill extends BaseModel {

    /**
     * 国内分配单ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "meetbill_id", primaryKeyFlag = true,desc = "国内分配单ID")
    private Long meetbillId;

    /**
     * 国内经销商ID
     */
    @XColumn(name = "dealer_id", desc = "国内经销商ID")
    private Long dealerId;

    /**
     * 国内订单明细ID
     */
    @XColumn(name = "order_d_id", desc = "国内订单明细ID")
    private Long orderDId;

    /**
     * 备货单ID
     */
    @XColumn(name = "stocking_id", desc = "备货单ID")
    private Long stockingId;

    /**
     * 订单号
     */
    @XColumn(name = "order_no", desc = "订单号")
    private String orderNo;

    /**
     * 订单类别  0 = 国内 1 = 海外
     */
    @XColumn(name = "order_category", desc = "订单类别")
    private Integer orderCategory;

    /**
     * 备件清单ID
     */
    @XColumn(name = "spare_part_id", desc = "备件清单ID")
    private Long sparePartId;

    /**
     * 分配数量
     */
    @XColumn(name = "meetnum", desc = "分配数量")
    private Integer meetnum;

    /**
     * 出库数量
     */
    @XColumn(name = "outnum", desc = "出库数量")
    private Integer outnum;

    /**
     * SNP
     */
    @XColumn(name = "snp", desc = "SNP")
    private Integer snp;

    /**
     * 总金额
     */
    @XColumn(name = "total_amount", desc = "总金额")
    private BigDecimal totalAmount;

    /**
     * 订单类型 0 = 普通订单 1 = 紧急订单 2=直送订单 3=客户订单 4=日产订单 5三包订单 6活动订单 7特殊订单
     */
    @XColumn(name = "order_type", desc = "订单类型")
    private Integer orderType;

    /**
     * 仓库ID
     */
    @XColumn(name = "ware_house_id", desc = "仓库ID")
    private Long wareHouseId;

    /**
     * 现款金额
     */
    @XColumn(name = "cash_amount", desc = "现款金额")
    private BigDecimal cashAmount;

    /**
     * 折扣金额
     */
    @XColumn(name = "discount_amount", desc = "折扣金额")
    private BigDecimal discountAmount;

    /**
     * 发票申请单号
     */
    @XColumn(name = "invsn", desc = "发票申请单号")
    private String invsn;

    /**
     * 销售价格
     */
    @XColumn(name = "sale_price", desc = "销售价格")
    private BigDecimal salePrice;

    /**
     * 发票号
     */
    @XColumn(name = "fpno", desc = "发票号")
    private String fpno;

    /**
     * 出库现款金额
     */
    @XColumn(name = "out_cash_amount", desc = "出库现款金额")
    private BigDecimal outCashAmount;

    /**
     * 出库现款金额
     */
    @XColumn(name = "out_discount_amount", desc = "出库折扣金额")
    private BigDecimal outDiscountAmount;

    /**
     * 是否欠拨   0 = 否 1 = 是
     */
    @XColumn(name = "owe_flag", desc = "是否欠拨")
    private Integer oweFlag;

    /**
     * 分配单号
     */
    @XColumn(name = "meetbillno", desc = "分配单号")
    private String meetbillno;

    /**
     * 状态 1 = 创建 4=备货完成 5 = 装箱完成 9 = 出库 A = 收货完成 B = 收货完成
     */
    @XColumn(name = "status", desc = "状态")
    private String status;

    /**
     * 仓库
     */
    private WareHouse refWareHouse;

    /**
     * 备件
     */
    private SparePartBaseView refSparePartBaseView;
}
